from tortoise import models, fields


class User(models.Model):
    id = fields.IntField(pk=True)
    username = fields.CharField(max_length=255)
    password = fields.CharField(max_length=255)
    age = fields.IntField()
    gender = fields.IntField()
    weight = fields.FloatField()
    avatar = fields.CharField(max_length=16384,null=True)
    job = fields.CharField(max_length=255,null=True)
    favorite = fields.CharField(null=True,max_length=255)  # 使用 JSONField 表示数组类型
    target = fields.JSONField(null=True)  # 使用 JSONField 表示数组类型
    token = fields.CharField(max_length=255,null=True)
    weight_change = fields.JSONField(null=True)
    time_sign = fields.DateField(null=False,format='%Y-%m-%d %H:%M:%S')
    height = fields.FloatField()
    role = fields.CharField(max_length=255,null=True)
    lastTime = fields.DateField(null=False,format='%Y-%m-%d %H:%M:%S')